import numpy as np

a = np.array([1, 2, 3, 4])


def sigmoid(x):
    return 1/(1+np.exp(-x))

def d_sigmoid(x):
    return np.exp(-x)/(1 + np.exp(-x))**2

def d2_sigmoid(x):
    return np.multiply(sigmoid(x), (np.ones(x.shape)-sigmoid(x)))

h =0.0000001

errors = []
for i in a:
    error = d2_sigmoid(i) - (sigmoid(i +h) - sigmoid(i))/h
    errors.append(error)


print(errors)